<template>
  <div class="configInfo">
    <h3>
      {{$t('configLazyLoad.channel.enterpriseTip100')}}
    </h3>
   <el-form class="form" ref="ruleForm" :rules="rules" :model="form"  label-position="left" label-width="160px">
      <el-form-item :label="$t('configLazyLoad.channel.enterpriseTip12')" prop="corpid">
        <el-input size="mini" v-model.trim="form.corpid" :disabled="showAddOrEditType === 'edit'"></el-input>
        <question-tooltip
          class="wechatPlatformTooltip"
          :direction="'bottom'"
          :tipContent="$t('configLazyLoad.channel.enterpriseTip101')">
        </question-tooltip>
      </el-form-item>
    </el-form>
    
    <div  class="btn">
       <el-button class="primary_btn" style="margin-right: 20px" @click="cancel()">{{$t('public.cancel')}}</el-button>
      <el-button type="primary" class="primary_btn" @click="nextStep()">{{$t('public.nextStep')}}</el-button>
    </div>
  </div>
</template>
<script>
// import { randomWord, deepClone } from '@/utils/m7Utils'
import questionTooltip from '@/components/ui-modules/questionToolTip/QuestionToolTip.vue'
import bus from '@/store/eventBus'
export default {
  name: 'enterpriseConfigInfo',
  data () {
    return {
      form: {},
      rules: {
        corpid: [
          { required: true, message: this.$t('validate.required'), trigger: 'blur' }
        ],
      },
    }
  },
  props: {
    configData: {
      type: Object,
      default:  () => {
        return {}
      }
    },
    showAddOrEditType: {
      type: String,
      default: () => {
        return 'add'
      }
    }
  },
  components: {
    questionTooltip
  },
  methods: {
    cancel () {
      bus.$emit('enterpriseCancel')
    },
    nextStep () {
      this.$emit('nextStep', "two")
    },
    // saveFun () {
    //   bus.$emit('enterpriseSaveFun')
    // },
    // initData () {
    //   let form = deepClone(this.configData)
    //   this.form.server_url = form.server_url
    //   this.form.token = form.token
    //   this.form.encoding_AESKey = form.encoding_AESKey
    // }
  },
  // beforeMount () {
  //  this.initData()
  // }
}
</script>
<style lang="stylus" scoped>
  @import "../../../../../assets/common.styl"
  .configInfo
    margin 30px auto
    width 540px
    h3
      text-align left
      margin-bottom 10px
      font-weight bold
    .btn
      margin-top 20px  
    .form
      margin-top 30px
      width 500px
    .wechatPlatformTooltip
      position absolute
      right -26px    
      
</style>